home *** CD-ROM | disk | FTP | other *** search
- Path: astfgl.idb.hist.no!not-for-mail
- From: anneu@colargol.idb.hist.no (Anne Kristine Ugedal)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: SetRGB32() doesn't do what it should...
- Date: 9 Feb 1996 09:46:04 GMT
- Organization: Sor-Trondelag College, Norway
- Message-ID: <4ff54s$pal@astfgl.idb.hist.no>
- References: <425.6611T1194T2896@ulysses.sax.de>
- NNTP-Posting-Host: colargol.idb.hist.no
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Robby Paehlig (robby@ulysses.sax.de) wrote:
- : Here are some lines, that should change color 8 of my Workbench to blue:
- :
- : [...]
- : if(GfxBase = (struct GfxBase *)(OpenLibrary("graphics.library", 39L))) {
- : if(wb = LockPubScreen("Workbench")) {
- : SetRGB32(&(wb->ViewPort), 8, 0x0ul, 0x0ul, 0xFFul);
- : [...]
- :
- : Well, the color changes -- not to blue, but to black! What I'm doing wrong?
-
- The 8-bit value that you supplies are placed in the least significant part
- of the 32-bit long that's used for RGB-values. You'll have to shift
- the bits upwards a bit, 24 bits to be exact, like this:
-
- #define RGBSHIFT(a) ((a) << 24)
- SetRGB32(&(wb->ViewPort), 8, RGBSHIFT(0x0ul), RGBSHIFT(0x0ul), RGBSHIFT(0xFFul));
-
- --
- * Anne Kristine Ugedal *** Win.HLP AS, Norway - my employer *
- ** Spare time Amiga developer *** Office time Windows developer. **
- *** anneu@colargol.idb.hist.no *** anne@winhlp.no ***
- **** http://colargol.idb.hist.no/~anneu *** http://www.winhlp.no ****
-